package ro.k.tags;

import java.util.ArrayList;
import java.util.List;

import ro.k.web.beans.KBeanUtils;
import ro.k.web.beans.order.ReqManoperaBean;

public class ReqManopera {

	private List<ReqManoperaBean> reqMans = new ArrayList<ReqManoperaBean>();

	public List<ReqManoperaBean> getReqMans() {
		return reqMans;
	}

	public void addReqMan(ReqManoperaBean m) {
		reqMans.add(m);
	}

	public double getTotalTime() {
		double d = 0;
		for (ReqManoperaBean m : reqMans) {
			d += m.getDurata();
		}
		return d;
	}
	
	public double getTotalValoare() {
		double d = 0;
		for (ReqManoperaBean m : reqMans) {
			d += m.getValoare();
		}
		return d;
	}
	
	public void remove(String item){
		if(KBeanUtils.isEmpty(item)){
			return ;
		}
		try{
			int i = Integer.parseInt(item);
			reqMans.remove(i);
		}catch(Exception e){	
		}
	}
}
